<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>留言祝福——高青一中60年校庆</title>
		<script src="style/jquery132.js" type="text/javascript"></script>
		<link href="style/reset.css" rel="stylesheet" type="text/css"/>
		<link href="style/style.css" rel="stylesheet" type="text/css"/>
	</head>
 <body style="background-color:#FFF">
 <script type="text/javascript">
	function jsLTrim(str) {
		var rtnStr = "";
		for ( var i = 0; i < str.length; i++) {
			if (str.charAt(i) != " ") {
				rtnStr = str.substr(i);
				break;
			}
		}
		return rtnStr;
	}

	//==========================================
	// Trim right spaces
	//==========================================
	function jsRTrim(str) {
		var rtnStr = "";
		for ( var i = str.length - 1; i >= 0; i--) {
			if (str.charAt(i) != " ") {
				rtnStr = str.substring(0, i + 1);
				break;
			}
		}
		return rtnStr;
	}

	//==========================================
	//Purpose: Trim both left and right spaces
	//==========================================
	function jsTrim(str) {
		return (jsLTrim(jsRTrim(str)));
	}

	function chk(formObj) {
		var contentObj = formObj.wish_content.value;
		if(formObj.wish_owner.value == ""){
			alert("请留下姓名呀，亲！ ");
			formObj.wish_owner.focus();
			return false;			
		}
		if (jsTrim(contentObj) == "") {
			alert("留言内容不能为空呀，亲！ ");
			formObj.wish_content.focus();
			return false;
		}
		return true;
	}
	var maxlimit = 40;
    function  textCounter(field){
        if (field.value.length > maxlimit)
            field.value = field.value.substring(0,maxlimit);
    }
</script>
  <div class="content" style="background-color:#FFF">
				<form name="gbMessageClienForm" method="post" action="wishesAction!add.action" onsubmit="return chk(this)">
					
					<table border="0" cellpadding="0" cellspacing="0" width="440">
						<tbody>
							<tr>
								<td align="right" height="38" valign="top" width="86">
									姓名*：
								</td>
								<td width="335">
									<label>
										<input name="wish_owner" size="30" value="" type="text"/>
									</label>
								</td>
							</tr>
							<tr>
								<td align="right" valign="top">
									选项*：
								</td>
								<td>

									<label>
										<input name="wish_ownerstate" value="一中之友" type="radio" checked/>
										一中之友
									</label>

									<label>
										<input name="wish_ownerstate" value="在校学生" type="radio"/>
										在校生
									</label>

									<label>
										<input name="wish_ownerstate" value="教工" type="radio"/>
										教工
									</label>

									<label>
										<input name="wish_ownerstate" value="校友" type="radio"/>
										校友
									</label>

									<label>
										<input name="wish_ownerstate" value="考生" type="radio"/>
										考生
									</label>

									<label>
										<input name="wish_ownerstate" value="家长" type="radio"/>
										家长
									</label>

								</td>
							</tr>
							<br/>
							<tr>
								<td align="right" height="143" valign="top">
									留言*（40）：
								</td>
								<td>
									<label>
										<textarea id="editor1" name="wish_content" cols="40" rows="3" style="width:350px;height:100px;"
											onkeydown="textCounter(this);" onkeyup="textCounter(this);"></textarea>
									</label>
								</td>
							</tr>
							<tr>
								<td>
									&nbsp;
								</td>
								<td>
									<label>
										<input name="button" value="提交留言" type="submit"/>
									</label>
								</td>
							</tr>
						</tbody>
					</table>
  				</form>
			</div>
		<!-- <ckeditor:replace  replace="editor1" basePath="admin/ckeditor/"/> -->

 </body>
</html>
